package com.plian.system.wrapper.pf;

import com.plian.system.dto.pf.BusinessIndicatorsOldDTO;
import com.plian.system.entity.pf.BusinessIndicatorsOld;
import com.plian.system.mybatis.support.BaseWrapper;
import com.plian.system.vo.pf.BusinessIndicatorsOldVO;
import com.plian.system.wrapper.util.CacheWrapperUtil;
import com.plian.system.wrapper.util.WrapperUtil;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import static com.plian.system.wrapper.util.WrapperConstant.*;

/**
 * @Author: Take-off
 * @Description: TODO
 * @Date: 2023/1/9 1:55 PM
 * @Version: 1.0
 **/
@Mapper(componentModel = SPRING, uses = {CacheWrapperUtil.class, WrapperUtil.class})
public interface BusinessIndicatorsOldWrapper extends BaseWrapper<BusinessIndicatorsOld, BusinessIndicatorsOldDTO, BusinessIndicatorsOldVO> {

    /**
     * Entity转VO
     *
     * @param entity /
     * @return /
     */
    @Override
    @Mappings(value = {
            @Mapping(source = "createUser", target = "createUserName", qualifiedByName = USER_ID_TO_NAME),
            @Mapping(source = "updateUser", target = "updateUserName", qualifiedByName = USER_ID_TO_NAME),
            @Mapping(source = "indicatorsCategoryId", target = "indicatorsCategoryName", qualifiedByName = DICT_CODE_TO_NAME),
    })
    BusinessIndicatorsOldVO entityToVO(BusinessIndicatorsOld entity);
}
